package com.dyh.quickdemo.demos.lbdbean;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

import java.util.function.Consumer;

/*
@Author=Joey Wheeler
@Date=2020/12/30 10:57
*/
@Configuration
public class OrderBizPlan {

    @Autowired
    OrderBiz orderBiz;

    @Bean
    Consumer<String> orderBiz$push(){
        return ((Consumer<String>) orderBiz::createWmsOrder)
                .andThen(orderBiz::pushToWms)
                .andThen(orderBiz::updateWmsOrderStatus);
    }

    @Bean
    Consumer<String> orderBiz$createWmsOrder(){
        return orderBiz::createWmsOrder;
    }


    @Bean
    Consumer<String> orderBiz$pushToWms(){
        return orderBiz::pushToWms;
    }


    @Bean
    Consumer<String> orderBiz$updateWmsOrderStatus(){
        return orderBiz::updateWmsOrderStatus;
    }
}
